define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'work.attendance_statistics/index',
        delete_url: 'work.attendance_statistics/delete',
        export_url: 'work.attendance_statistics/export',
    };

    return {

        index: function () {
            ea.table.render({
                init: init,
                toolbar: ["refresh", "export"],
                cols: [[
                    { type: 'checkbox' },
                    { field: 'id', title: 'ID', width: 40, search: 'false' },
                    { field: 'statistics_date', title: '统计日期' , search: 'date'},
                    { field: 'work_days', title: '上班（天）', search: 'false' },
                    { field: 'rest_days', title: '休息（天）', search: 'false' },
                    { field: 'leave_days', title: '请假（天）', search: 'false' },
                    { field: 'drive_days', title: '驾驶（天）', search: 'false' },
                    { field: 'sum_duration', width: 160, title: '总计工时（天）', templet: '#work_duration', search: 'false' },
                    {
                        width: 250, title: '操作', templet: ea.table.tool,
                        operat: ["delete"]
                    },

                ]],
            });

            ea.listen();
        },
    };
});